Add RocksDB native compaction policy task#156
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the Frontier-CS 2.0 “LSM compaction policy” problem package, including documentation, a local evaluator/harness, and a reference policy implementation.
Changes:
- Introduce a baseline/reference policy (
reference.py) and problem statement (readme). - Add a full offline evaluator and sandbox runner (
evaluator.py) plus a convenience entrypoint script (evaluate.sh). - Add runtime/submission metadata for the task (
config.yaml).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| 2.0/problems/lsm_compaction_policy/reference.py | Adds a simple reference compaction policy used for baseline behavior. |
| 2.0/problems/lsm_compaction_policy/readme | Documents the task, policy interface, observation schema, scoring, and restrictions. |
| 2.0/problems/lsm_compaction_policy/evaluator.py | Implements the simulator, scoring, sandboxed policy runner, and case generation. |
| 2.0/problems/lsm_compaction_policy/evaluate.sh | Adds a shell wrapper to run the evaluator against a solution path. |
| 2.0/problems/lsm_compaction_policy/config.yaml | Declares environment/runtime and submission contract for the task. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @bochencs, thanks for your contribution. Can you implement an LSM tree task in a database-native environment such as rocksDB? maybe refer our duckdb_e2e_optimization problems. I think RocksDB is where the most LSM tree research will implement their code |
@joyemang33 Thanks for the quick check! That make sense for me, let me work on it |
|
something might also be useful: https://arxiv.org/pdf/2501.16759v3 |
16dc172 to
eda84cc
Compare
|
@joyemang33 I have replaced the simulator with a native RocksDB task. I also read the paper you linked, although it focuses on joins rather than compaction, it reinforced that the benchmark should operate on a real RocksDB implementation. The task pins RocksDB v10.10.1 at Final evaluation uses two hidden seeds for each of seven workload families. Correctness is checked through reads, snapshots, background errors, reopen, and a complete iterator comparison. An unmodified binary then drains residual compaction work, so deferring work does not improve the score. The reference patch completed all 14 final cases with The PR includes the Dockerfile, harness, pinned source checksum, and build script. It currently uses the local tag |
|
@joyemang33 Thank u so much! @momoway will help you review the task |
|
Hi @bochencs — this is a great task and definitely worth adding to Frontier-CS 2.0! I ran an additional full Harbor trial of it (codex + gpt-5.5) and hit two issues worth addressing before merge. 1. Invalid submissions outscore valid ones on 2. The score scale has no discrimination. The reference solution scores 3.32/100, and all agent trials so far (your three plus mine) score exactly 0. Since the reference is strong and clearly hard for current models to reach, I'd calibrate it so the reference lands at a high score — e.g. tune the target so it comes out around 50 or 80 — so the task can actually separate models instead of collapsing everything to 0. |
…cale Address review feedback on FrontierCS#156: - _invalid() now returns score_unbounded = -1e6 so Harbor's (score, score_unbounded) best-artifact selection can never prefer an invalid submission over a valid or empty one; the empty no-op patch keeps (0.0, 0.0) as the documented neutral baseline. - TARGET_ROBUST_GAIN 1.20 -> 1.017: the reference patch (robust_gain ~1.011 on the final suite) lands near 50 instead of 3.32. The 1.005 noise deadband and every validity/breadth/regression gate are unchanged, so the zero-vs-positive frontier is identical. - readme scoring section updated; evaluator tests extended 26 -> 31. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@momoway Thanks for the review! I pushed a quick fix so that invalid submissions now return a score_unbounded sentinel of −1e6 so they always rank below valid attempts, and the scale is recalibrated (target 1.20 → 1.017). Local validation tests extended and looks good! Happy to fix any other issues if needed. |
|
@bochencs LGTM! Thanks for the fix, I'll merge the PR. |
Summary
Adds a Frontier-CS 2.0 systems task for optimizing leveled compaction selection in a pinned RocksDB v10.10.1 checkout. Recent LSM-tree research continues to study workload-aware compaction and write-amplification tradeoffs; this task evaluates whether agents can produce robust picker changes across hidden native workloads.
The judge builds the submitted patch against RocksDB, checks snapshots, range deletes, multiple column families, reopen behavior, and full iterator contents, then measures write, read, and space amplification together with trusted residual compaction debt.
Type of Change
Testing
GPT-5.5 difficulty check
Three independent Harbor trials used the full 10800-second agent budget and completed with valid, non-empty patches and all 14 final cases. None achieved a positive score.
Judge Image
The task includes the judge Dockerfile, pinned RocksDB commit and archive checksum, native harness, and build script. The config currently uses the local experimental tag below, following the existing custom-image task pattern:
For the final image, would you prefer that I publish it under my GHCR namespace, or should it be hosted under the FrontierCS organization?
Checklist
CI Validation (for new problems)
The reference patch is included as both
reference.patchfor the Harbor adapter andreference.cppfor the current C++ reference lookup.